<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>会员信息详情</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>

<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.ui.position.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Plugins/ContextMenu/src/jquery.contextMenu.js"></script>
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Css/etgrid.css">
<script src="{$NOW_THEME_URL}/Assets/Plugins/Etgrid/Js/etgrid.js"></script>

<!--滑动门插件开始-->
<script src="{$NOW_THEME_URL}/Assets/Plugins/EtTab/Js/ettab.js"></script>
<!--滑动门插件结束-->
</head>

<body>
	<div class="page_header">
		<div class="table_tool">
		<ul class="clearfix">			
			<li class="changeCard btn"><i class="icon-credit-card"></i> 换卡</li>
			<li class="line"></li>
			<li class="btn" id="upgrade"><i class="icon-long-arrow-up"></i> 会员升级</li>
			<li class="line"></li>
			<li class="vipTransfer btn">
				<i class="icon-yen"></i> 会员转账
				<ul class="submenu">
					<li toid="money"><i class="icon-caret-right"></i> 储值转账</li>
					<li toid="credit"><i class="icon-caret-right"></i> 积分转账</li>
				</ul>
			</li>
			<li class="line"></li>
			<li class="consumerRecharge btn">
				<i class="icon-yen"></i> 充值消费
				<ul class="submenu">
					<li toid="rechargeMoney"><i class="icon-caret-right"></i> 储值充值</li>
					<li toid="consumptionMoney"><i class="icon-caret-right"></i> 储值消费</li>
					<li toid="rechargeCredit"><i class="icon-caret-right"></i> 积分充值</li>
					<li toid="consumptionCredit"><i class="icon-caret-right"></i> 积分消费</li>
				</ul>
			</li>
			<li class="line"></li>
			<li class="resetPassword btn">
				<i class="icon-retweet"></i> 重置密码
				<ul class="submenu">
					<li toid="manualReset"><i class="icon-caret-right"></i> 手工重置</li>
					<li toid="smsReset"><i class="icon-caret-right"></i> 短信重置</li>
				</ul>
			</li>
			<li class="line"></li>
			<li class="memberDel btn"><i class="icon-random"></i> 更换门店</li>
		</ul>
	</div>
		<div class="tabbar">
			<ul class="tab clearfix" tabname="tab1">
				<li class="tabhover" show="tab1_0">会员信息</li>
				<li show="tab1_1" fortab="tab1">积分记录</li>
				<li show="tab1_2" fortab="tab1">储值记录</li>
				<li show="tab1_3" fortab="tab1">积分兑换</li>
				<li show="tab1_4" fortab="tab1">消费记录</li>
				<li show="tab1_5" fortab="tab1">计次信息</li>
				<li show="tab1_6" fortab="tab1">服务计划</li>
				<li show="tab1_7" fortab="tab1">退货记录</li>
			</ul>
		</div>
	</div>
	<div class="tabcontent">
		<div class="page_wraper" id="tab1_0" fortab="tab1">
			<form action="" method="post" id="memberAdd_form">
			<input type="hidden" name="customid" id="customid" value="{$detail.id}">
			<table cellpadding="0" cellspacing="0" class="module_form" width="600">
			<fieldset>
				<tr>
					<td class="ele_title"><label for="cardnum">会员卡号：<em>*</em></label></td>
					<td class="ele_content">{$detail.vipno}</td>
					<td class="ele_title"><label for="level">会员级别：<em>*</em></label></td>
					<td class="ele_content">
						{$detail.cardname}
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="realname">姓名：</label></td>
					<td class="ele_content">{$detail.realname}</td>
					<td class="ele_title"><label for="sex">性别：</label></td>
					<td class="ele_content">
						<eq name="detail.sex" value="1">先生<else />女士</eq>
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="iccard">身份证号：</label></td>
					<td class="ele_content">{$detail.idcard}</td>
					<td class="ele_title"><label for="birth">生日：</label></td>
					<td class="ele_content">{$detail.birthday}</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="phone">手机号码：</label></td>
					<td class="ele_content">{$detail.mobile}</td>
					<td class="ele_title"><label for="telphone">固定电话：</label></td>
					<td class="ele_content">{$detail.phone}</td>
				</tr>
				</fieldset>
				<tr>
					<td colspan="4" class="ele_title erji_title">详细信息</td>
				</tr>
				<fieldset>
				<tr>
					<td class="ele_title"><label for="postcode">QQ：</label></td>
					<td class="ele_content">{$detail.qq}</td>
					<td class="ele_title"><label for="email">电子邮件：</label></td>
					<td class="ele_content">{$detail.email}</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="address1">所在省：</label></td>
					<td colspan="3" class="ele_content">湖南省
						<label for="address2">所在市：</label>
						长沙市		
						<label for="address3">所在区：</label>			
						天心区
					</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="d_input">详细地址：</label></td>
					<td colspan="3" class="ele_content">{$detail.address}</td>
				</tr>
				<tr>
					<td class="ele_title"><label for="remark">备注：</label></td>
					<td colspan="3" class="ele_content">{$detail.remark}</td>
				</tr>
				</fieldset>
				<tr>
					<td colspan="4" class="print"><input name="" type="checkbox" value="">自动打印小票</td>
				</tr>
			</table>
			</form>
		</div>
		<div id="tab1_1" fortab="tab1" dosome="true" dofun="getCreditRecords" class="clearfix">
			<div class="table_box" id="box1" gridId="consumerRecords">
			</div>
		</div>
		<div id="tab1_2" fortab="tab1" dosome="true" dofun="getMoneyRecords" class="clearfix">
			<div class="table_box" id="box2" gridId="consumerRecords">
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	//实例化滑动门
	var tabConfig = {
			tabName: 'tab1',
			tabHeader: '.tab',
			tabContent: '.tabcontent',
			tabContentFun : {
				'getCreditRecords' : function(){
					var testConfig = {
							gridId : 'creditRecords',
							blockBox : '#box1',
							blockBoxHeight : 'window',
							jsonUrl : '__URL__/getCreditRecords/customid/'+$("#customid").val(),
							where : '',
							getWhere : null,
							widthType : 'thw', //thw-标题标准宽度、thw-数据单元标准宽度、auto-随数据单元宽度
							pageNum : 10,
							nowPage : 1,
							orderName : "addtime",
							orderDirection : "desc",
							dataContextMenuOpen: false, //是否开启数据行右键菜单
							dataContextMenu: null,
							colModel : [
								{
									display : '所属商户',
									name : 'company',
									sortable : true,
									myclass : 'center',
									edit : false,
									width:'100px',
								},
								{
									display : '所属门店',
									name : 'outletid',
									sortable : true,
									myclass : 'center',
									edit : false,
									width:'100px',
								},
								{
									display : '积分',
									name : 'val',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'150px',
								},
								{
									display : '操作类型',
									name : 'act',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'100px',
								},
								{
									display : '备注',
									name : 'remark',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'100px',
								},
								{
									display : '操作时间',
									name : 'addtime',
									sortable : true,
									myclass : 'left',
									edit : false
								},
								{
									display : '操作者',
									name : 'addid',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'100px',
								}
							]
						};
					
					//实例化列表
					if($.EtGrid.list['creditRecords']){
						//$.EtGrid.list['creditRecords'].refresh();
					}else{
						$('#box1').EtGrid(testConfig);
					}
				},
				'getMoneyRecords' : function(){
					var moneyConfig = {
							gridId : 'moneyRecords',
							blockBox : '#box2',
							blockBoxHeight : 'window',
							jsonUrl : '__URL__/getMoneyRecords/customid/'+$("#customid").val(),
							where : '',
							getWhere : null,
							widthType : 'thw', //thw-标题标准宽度、thw-数据单元标准宽度、auto-随数据单元宽度
							pageNum : 10,
							nowPage : 1,
							orderName : "addtime",
							orderDirection : "desc",
							dataContextMenuOpen: false, //是否开启数据行右键菜单
							dataContextMenu: null,
							colModel : [
								{
									display : '所属商户',
									name : 'company',
									sortable : true,
									myclass : 'center',
									edit : false,
									width:'100px',
								},
								{
									display : '所属门店',
									name : 'outletid',
									sortable : true,
									myclass : 'center',
									edit : false,
									width:'100px',
								},
								{
									display : '金额',
									name : 'val',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'150px',
								},
								{
									display : '操作类型',
									name : 'act',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'100px',
								},
								{
									display : '备注',
									name : 'remark',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'100px',
								},
								{
									display : '操作时间',
									name : 'addtime',
									sortable : true,
									myclass : 'left',
									edit : false
								},
								{
									display : '操作者',
									name : 'addid',
									sortable : true,
									myclass : 'left',
									edit : false,
									width:'100px',
								}
							]
						};
					
					//实例化列表
					if($.EtGrid.list['moneyRecords']){
						//$.EtGrid.list['moneyRecords'].refresh();
					}else{
						$('#box2').EtGrid(moneyConfig);
					}
				}
			}
		};
	
	//实例化列表
	var memberTab = $('body').EtTab(tabConfig);
</script>

<script type="text/javascript">
	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;
	
	$(function(){
		//滑动门
		$('.tabbar li').click(function(){
			var tabname = $('.tabbar>ul').attr('tabname');
			$('.tabbar li').removeClass('tabhover');
			$(this).addClass('tabhover');
			
			$('div[fortab="'+tabname+'"]').hide();
			$('#'+$(this).attr('show')).show();
		});
		
		//表格隔行换色
		$('.module_form tr:odd').addClass('odd');
		$('.module_form tr:even').addClass('even');
		
		//表单操作
		//重置
		$('.form_ele_reset').on('click',function(){
			$('#memberAdd_form').get(0).reset();
		});
		
		//换卡
		$('.changeCard').on('click',function(){
			//弹出一个新窗口
			var href = "{:U('Vipcard/changeCard')}&id="+$('#customid').val();
			var width = '350px';
			var height = '200px';
			var title = '会员卡换卡';
			openDialog('changeCard',href,width,height,title);
		})
		
		//升级
		$('#upgrade').on('click',function(){
			//弹出一个新窗口
			var id    = $("#customid").val();
			var href = "{:U('Custom/upgrade')}&id="+id;
			var width = '500px';
			var height = '300px';
			var title = '会员卡升级';
			openDialog('customUpgrade',href,width,height,title);
		})
		
		//储值转账
		$('.vipTransfer .submenu>li').on('click',function(){
			
			var toid = $(this).attr('toid');
			
			if(toid=="money"){
				//弹出一个新窗口
				var href = "{:U('Vipcard/transferMoney')}&id="+$('#customid').val();
				var width = '570px';
				var height = '320px';
				var title = '储值转账';
				openDialog('transferMoney',href,width,height,title);
			}else{
				//弹出一个新窗口
				var href = "{:U('Vipcard/transferCredit')}&id="+$('#customid').val();
				var width = '570px';
				var height = '320px';
				var title = '积分转账';
				openDialog('transferCredit',href,width,height,title);
			}
		})
		
		//充值消费 
		$('.consumerRecharge .submenu>li').on('click',function(){
			
			var toid = $(this).attr('toid');
			
			if(toid=="rechargeMoney"){
				var href = "{:U('Vipcard/rechargeMoney')}&id="+$('#customid').val();
				var width = '380px';
				var height = '260px';
				var title = '储值充值';
				openDialog('rechargeMoney',href,width,height,title);
			}
			if(toid=="consumptionMoney"){
				var href = "{:U('Vipcard/consumptionMoney')}&id="+$('#customid').val();
				var width = '380px';
				var height = '300px';
				var title = '储值消费';
				openDialog('consumptionMoney',href,width,height,title);
			}
			if(toid=="rechargeCredit"){
				var href = "{:U('Vipcard/rechargeCredit')}&id="+$('#customid').val();
				var width = '380px';
				var height = '260px';
				var title = '积分充值';
				openDialog('rechargeCredit',href,width,height,title);
			}
			if(toid=="consumptionCredit"){
				var href = "{:U('Vipcard/consumptionCredit')}&id="+$('#customid').val();
				var width = '380px';
				var height = '300px';
				var title = '积分消费';
				openDialog('consumptionCredit',href,width,height,title);
			}
		})
		
		//重置密码
		$('.resetPassword .submenu>li').on('click',function(){
			
			var toid = $(this).attr('toid');
			
			if(toid=='manualReset'){
				//弹出一个新窗口
				var href = "{:U('Vipcard/reset')}&id="+$('#customid').val();
				var width = '400px';
				var height = '220px';
				var title = '重置密码';
				openDialog('vipcardReset',href,width,height,title);
			}else{
				
				var msg = "确认要重置会员密码，并发送新密码到会员手机？";
				windowApi.lhgdialog.confirm(msg, function(){
					return;
				},function(){
					return;
				});
			}
		})
	});
</script>
</html>
